{include file="public/header" /}
<title></title>
</head>

<body>
	<article class="page-container">
		<form class="form form-horizontal" id="form-admin-add" method="post">
			<div class="row cl">
				<label class="form-label col-xs-4 col-sm-3"><span class="c-red">*</span>采宝商户密钥：</label>
				<div class="formControls col-xs-8 col-sm-9">
					<input type="text"  value="{$id}" id="id" style="display: none;">
					<input type="text" class="input-text" value="{$data.cb_miyao}" placeholder="" id="cb_miyao" name="cb_miyao">
				</div>
			</div>
			<div class="row cl">
				<label class="form-label col-xs-4 col-sm-3"><span class="c-red">*</span>采宝商户号：</label>
				<div class="formControls col-xs-8 col-sm-9">
					<input type="text" class="input-text" value="{$data.cb_no}" placeholder="" id="cb_no" name="cb_no">
				</div>
			</div>
			<div class="row cl">
				<label class="form-label col-xs-4 col-sm-3"><span class="c-red">*</span>采宝员工编号：</label>
				<div class="formControls col-xs-8 col-sm-9">
					<input type="text" class="input-text" value="{$data.cb_clerk}" placeholder="" id="cb_clerk" name="cb_clerk">
				</div>
			</div>
			<div class="row cl">
				<label class="form-label col-xs-4 col-sm-3"><span class="c-red">*</span>采宝银行费率：</label>
				<div class="formControls col-xs-8 col-sm-9">
					<input type="text" class="input-text" value="{$data.cb_huilu}" placeholder="" id="cb_huilu" name="cb_huilu">
				</div>
			</div>
			<div class="row cl">
				<label class="form-label col-xs-4 col-sm-3"><span class="c-red">*</span>采宝_登录账号：</label>
				<div class="formControls col-xs-8 col-sm-9">
					<input type="text" class="input-text" value="{$data.cb_login_name}" placeholder="" id="cb_login_name" name="cb_login_name">
				</div>
			</div>
			<div class="row cl">
				<label class="form-label col-xs-4 col-sm-3"><span class="c-red">*</span>采宝_登录密码：</label>
				<div class="formControls col-xs-8 col-sm-9">
					<input type="text" class="input-text" value="{$data.password}" placeholder="" id="password" name="password">
				</div>
			</div>
			<div class="row cl">
				<div class="col-xs-8 col-sm-9 col-xs-offset-4 col-sm-offset-3">
					<input class="btn btn-primary radius" id='tijiao' type="button" value="&nbsp;&nbsp;提交&nbsp;&nbsp;">
				</div>
			</div>
		</form>
	</article>
	{include file="public/footer" /}
	<script type="text/javascript">
		$(function() {
			$('.skin-minimal input').iCheck({
				checkboxClass: 'icheckbox-blue',
				radioClass: 'iradio-blue',
				increaseArea: '20%'
			});

			$('#tijiao').click(function() {
				$.ajax({
					type: 'post',
					data: {
						id				: $('#id').val(),
						cb_miyao		: $('#cb_miyao').val(),
						cb_no			: $('#cb_no').val(),
						cb_clerk		: $('#cb_clerk').val(),
						cb_huilu		: $('#cb_huilu').val(),
						password		: $('#password').val(),
						cb_login_name	: $('#cb_login_name').val()
						
					},
					url: "{:url('accounts/agent_nh')}",
					success: function(data) {
						if(data.code == 200) {
							layer.msg(data.msg, {
								icon: 1,
								time: 1000
							}, function() {
								window.parent.location.reload();
								var index = parent.layer.getFrameIndex(window.name);
								parent.layer.close(index);
							});
						} else {
							layer.msg(data.msg, {
								icon: 1,
								time: 1000
							});
						}

					},
					error: function(XmlHttpRequest, textStatus, errorThrown) {
						layer.msg(data.msg, {
							icon: 1,
							time: 1000
						});
					}
				});
			});
		});
	</script>